package com.heiye.count.biz.domain.mapper;

import com.heiye.count.biz.domain.dataobject.CommentCountDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommentCountDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CommentCountDO record);

    int insertSelective(CommentCountDO record);

    CommentCountDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CommentCountDO record);

    int updateByPrimaryKey(CommentCountDO record);

    /**
     * 更新评论点赞数
     *
     * @param count
     * @param commentId
     * @return
     */
    int insertOrUpdateLikeTotalByCommentId(@Param("count") Integer count,
                                           @Param("commentId") Long commentId);


    /**
     * 根据评论 ID 批量查询
     *
     * @param commentIds
     * @return
     */
    List<CommentCountDO> selectByCommentIds(@Param("commentIds") List<Long> commentIds);
}